package com.eaoa.vo.pub.base;

import java.io.Serializable;

import com.eaoa.vo.pub.PubDatadictionary;
import com.eaoa.vo.pub.PubDditem;


/**
 * This is an object that contains data related to the PUB_DDITEM table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="PUB_DDITEM"
 */

public abstract class BasePubDditem  implements Serializable {

	public static String REF = "PubDditem";
	public static String PROP_PARENT = "parent";
	public static String PROP_ITEMNAME = "itemname";
	public static String PROP_ITEMCODE = "itemcode";
	public static String PROP_PARENTNO = "parentno";
	
	public static String PROP_ITEMORDER = "itemorder";
	public static String PROP_ITEMNO = "itemno";
	public static String PROP_PUB_DATADICTIONARY = "pubDatadictionary";
	public static String PROP_ISLOCK = "islock";


	// constructors
	public BasePubDditem () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BasePubDditem (java.lang.Long itemno) {
		this.setItemno(itemno);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BasePubDditem (
		java.lang.Long itemno,
		PubDatadictionary pubDatadictionary,
		PubDditem parent) {

		this.setItemno(itemno);
		this.setPubDatadictionary(pubDatadictionary);
		this.setParent(parent);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long itemno;

	// fields
	private java.lang.String itemcode;
	private java.lang.String itemname;
	private java.lang.String islock;
	private java.lang.String itemdesc;
	private java.lang.Long itemorder;
	private java.lang.Long parentno;

	// many to one
	private PubDatadictionary pubDatadictionary;
	private PubDditem parent;

	// collections
	private java.util.Set  children;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="ITEMNO"
     */
	public java.lang.Long getItemno () {
		return itemno;
	}

	/**
	 * Set the unique identifier of this class
	 * @param itemno the new ID
	 */
	public void setItemno (java.lang.Long itemno) {
		this.itemno = itemno;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: ITEMCODE
	 */
	public java.lang.String getItemcode () {
		return itemcode;
	}

	/**
	 * Set the value related to the column: ITEMCODE
	 * @param itemcode the ITEMCODE value
	 */
	public void setItemcode (java.lang.String itemcode) {
		this.itemcode = itemcode;
	}



	/**
	 * Return the value associated with the column: ITEMNAME
	 */
	public java.lang.String getItemname () {
		return itemname;
	}

	/**
	 * Set the value related to the column: ITEMNAME
	 * @param itemname the ITEMNAME value
	 */
	public void setItemname (java.lang.String itemname) {
		this.itemname = itemname;
	}



	/**
	 * Return the value associated with the column: ISLOCK
	 */
	public java.lang.String getIslock () {
		return islock;
	}

	/**
	 * Set the value related to the column: ISLOCK
	 * @param islock the ISLOCK value
	 */
	public void setIslock (java.lang.String islock) {
		this.islock = islock;
	}



	/**
	 * Return the value associated with the column: ITEMORDER
	 */
	public java.lang.Long getItemorder () {
		return itemorder;
	}

	/**
	 * Set the value related to the column: ITEMORDER
	 * @param itemorder the ITEMORDER value
	 */
	public void setItemorder (java.lang.Long itemorder) {
		this.itemorder = itemorder;
	}



	/**
	 * Return the value associated with the column: PARENTNO
	 */
	public java.lang.Long getParentno () {
		return parentno;
	}

	/**
	 * Set the value related to the column: PARENTNO
	 * @param parentno the PARENTNO value
	 */
	public void setParentno (java.lang.Long parentno) {
		this.parentno = parentno;
	}



	/**
	 * Return the value associated with the column: DDNO
	 */
	public PubDatadictionary getPubDatadictionary () {
		return pubDatadictionary;
	}

	/**
	 * Set the value related to the column: DDNO
	 * @param pubDatadictionary the DDNO value
	 */
	public void setPubDatadictionary (PubDatadictionary pubDatadictionary) {
		this.pubDatadictionary = pubDatadictionary;
	}



	/**
	 * Return the value associated with the column: PARENTNO
	 */
	public PubDditem getParent () {
		return parent;
	}

	/**
	 * Set the value related to the column: PARENTNO
	 * @param parent the PARENTNO value
	 */
	public void setParent (PubDditem parent) {
		this.parent = parent;
	}



	/**
	 * Return the value associated with the column: children
	 */
	public java.util.Set  getChildren () {
		return children;
	}

	/**
	 * Set the value related to the column: children
	 * @param children the children value
	 */
	public void setChildren (java.util.Set  children) {
		this.children = children;
	}

	public void addTochildren (PubDditem pubDditem) {
		if (null == getChildren()) setChildren(new java.util.TreeSet ());
		getChildren().add(pubDditem);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof PubDditem)) return false;
		else {
			PubDditem pubDditem = (PubDditem) obj;
			if (null == this.getItemno() || null == pubDditem.getItemno()) return false;
			else return (this.getItemno().equals(pubDditem.getItemno()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getItemno()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getItemno().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

	public java.lang.String getItemdesc() {
		return itemdesc;
	}

	public void setItemdesc(java.lang.String itemdesc) {
		this.itemdesc = itemdesc;
	}


}